import request from '/@/utils/request';

export function getLocationOptions(query: Object) {
    return request({
        url: '/api/v1/system/location/options',
        method: 'get',
        params: query
    })
}

export function getLocationPage(query: Object) {
    return request({
        url: '/api/v1/system/location/list',
        method: 'get',
        params: query
    })
}

export function getLocation(query: Object) {
    return request({
        url: '/api/v1/system/location/detail',
        method: 'get',
        params: query
    })
}

export function addLocation(params?: Object) {
    return request({
        url: '/api/v1/system/location/add',
        method: 'post',
        data: params
    })
}
export function setLocationDefault(params?: Object) {
    return request({
        url: '/api/v1/system/location/set/default',
        method: 'post',
        data: params
    })
}

export function updateLocation(params?: Object) {
    return request({
        url: '/api/v1/system/location/update',
        method: 'put',
        data: params
    })
}

export function deleteLocation(params?: Object) {
    return request({
        url: '/api/v1/system/location/delete',
        method: 'delete',
        data: params
    })
}
